//package com.wnx.job.common.controller;
//
//import com.wnx.job.common.api.CommonPage;
//import com.wnx.job.common.api.CommonResult;
//import com.wnx.job.common.service.EsPostService;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import org.springframework.data.domain.Page;
//import org.springframework.web.bind.annotation.*;
//
//import javax.annotation.Resource;
//import java.util.List;
//
///**
// * @author by wangnaixing
// * @Description
// * @Date 2021/12/22 12:22
// */
//
//@RestController
//@Api(tags = "EsPostController", description = "搜索职位管理")
//@RequestMapping("/esProduct")
//public class EsPostController {
//    @Resource
//    private EsPostService esProductService;
//
//    @ApiOperation(value = "导入所有数据库中职位到ES")
//    @PostMapping( "/importAll")
//    public CommonResult<Integer> importAllList() {
//        int count = esProductService.importAll();
//        return CommonResult.success(count);
//    }
//
//    @ApiOperation(value = "根据id删除商品")
//    @GetMapping("/delete/{id}")
//    public CommonResult<Object> delete(@PathVariable Long id) {
//        esProductService.delete(id);
//        return CommonResult.success(null);
//    }
//
//    @ApiOperation(value = "根据id批量删除商品")
//    @GetMapping( "/delete/batch")
//    public CommonResult<Object> delete(@RequestParam("ids") List<Long> ids) {
//        esProductService.delete(ids);
//        return CommonResult.success(null);
//    }
//
//    @ApiOperation(value = "简单搜索")
//    @GetMapping( "/search/simple")
//    public CommonResult<CommonPage<EsPost>> search(@RequestParam(required = false) String keyword,
//                                                   @RequestParam(required = false, defaultValue = "0") Integer pageNum,
//                                                   @RequestParam(required = false, defaultValue = "5") Integer pageSize) {
//        Page<EsPost> search = esProductService.search(keyword, pageNum, pageSize);
//        return CommonResult.success(CommonPage.restPage(search));
//    }
//
//}
